package com.example.myapplication;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;

import androidx.annotation.Nullable;

public class PaiChart extends View {
int radius =0;


    public PaiChart(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        TypedArray ta =context.obtainStyledAttributes(attrs,R.styleable.PaiChart);
        radius =(int) ta.getDimension(R.styleable.PaiChart_radius,100);
    ta.recycle();
    }
    @Override
    protected  void onDraw(Canvas canvas){
        super.onDraw(canvas);
        RectF rectF =new RectF(0,0,2*radius,2*radius);
        Paint paint =new Paint(Color.BLUE);
        paint.setStyle( Paint.Style.FILL_AND_STROKE);
        canvas.drawArc(rectF,0,360,true,paint);
    }
    }

